public static GraphicsDeviceManager graphics;
SpriteBatch spriteBatch;
- // Input Handler
- KeyboardState currentKeyboardState;
- GamePadState currentGamePadState;
-
- MainShip player;
-
public SuperPolarity()
: base()
{
SuperPolarity.graphics = new GraphicsDeviceManager(this);
SuperPolarity.graphics.PreferMultiSampling = true;
Content.RootDirectory = "Content";
+ ActorFactory.SetContentManager(Content);
}
/// <summary>
/// </summary>
protected override void Initialize()
{
- player = new MainShip();
-
base.Initialize();
}
Vector2 playerPosition = new Vector2(GraphicsDevice.Viewport.TitleSafeArea.X, GraphicsDevice.Viewport.TitleSafeArea.Y + GraphicsDevice.Viewport.TitleSafeArea.Height / 2);
- player.Initialize(Content, Content.Load<Texture2D>("Graphics\\main-ship"), playerPosition);
+ ActorFactory.CreateMainShip(playerPosition);
}
/// <summary>
// TODO: Add your update logic here
InputController.UpdateInput();
- player.Update(gameTime);
+ ActorManager.Update(gameTime);
base.Update(gameTime);
}
spriteBatch.Begin();
- player.Draw(spriteBatch);
+ ActorManager.Draw(spriteBatch);
spriteBatch.End();